﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.HtmlControls;
using JqueryNet.FormControl.FormHtmlControl;
using System.Web.UI;

namespace JqueryNet.FormControl
{
    public class HtmlControlFactory : ControlFactory
    {
        public override IJQuery CreateIJquery(System.Web.UI.Control _control)
        {
            switch (_control.GetType().FullName)
            {
                case "System.Web.UI.HtmlControls.HtmlAnchor":
                    return new JHtmlAnchor(GetAsType<HtmlAnchor>(_control));
                case "System.Web.UI.HtmlControls.HtmlForm":
                    return new JHtmlForm(GetAsType<HtmlForm>(_control));
                case "System.Web.UI.HtmlControls.HtmlGenericControl":
                    return new JHtmlGenericControl(GetAsType<HtmlGenericControl>(_control));
                case "System.Web.UI.HtmlControls.HtmlHead":
                    return new JHtmlHead(GetAsType<HtmlHead>(_control));
                case "System.Web.UI.HtmlControls.HtmlImage":
                    return new JHtmlImage(GetAsType<HtmlImage>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputButton":
                    return new JHtmlInputButton(GetAsType<HtmlInputButton>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputCheckBox":
                    return new JHtmlInputCheckBox(GetAsType<HtmlInputCheckBox>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputFile":
                    return new JHtmlInputFile(GetAsType<HtmlInputFile>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputHidden":
                    return new JHtmlInputHidden(GetAsType<HtmlInputHidden>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputImage":
                    return new JHtmlInputImage(GetAsType<HtmlInputImage>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputPassword":
                    return new JHtmlInputPassword(GetAsType<HtmlInputPassword>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputRadioButton":
                    return new JHtmlInputRadioButton(GetAsType<HtmlInputRadioButton>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputReset":
                    return new JHtmlInputReset(GetAsType<HtmlInputReset>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputSubmit":
                    return new JHtmlInputSubmit(GetAsType<HtmlInputSubmit>(_control));
                case "System.Web.UI.HtmlControls.HtmlInputText":
                    return new JHtmlInputText(GetAsType<HtmlInputText>(_control));
                case "System.Web.UI.HtmlControls.HtmlLink":
                    return new JHtmlLink(GetAsType<HtmlLink>(_control));
                case "System.Web.UI.HtmlControls.HtmlMeta":
                    return new JHtmlMeta(GetAsType<HtmlMeta>(_control));
                case "System.Web.UI.HtmlControls.HtmlSelect":
                    return new JHtmlSelect(GetAsType<HtmlSelect>(_control));
                case "System.Web.UI.HtmlControls.HtmlTable":
                    return new JHtmlTable(GetAsType<HtmlTable>(_control));
                case "System.Web.UI.HtmlControls.HtmlTableCell":
                    return new JHtmlTableCell(GetAsType<HtmlTableCell>(_control));
                case "System.Web.UI.HtmlControls.HtmlTableRow":
                    return new JHtmlTableRow(GetAsType<HtmlTableRow>(_control));
                case "System.Web.UI.HtmlControls.HtmlTextArea":
                    return new JHtmlTextArea(GetAsType<HtmlTextArea>(_control));
                case "System.Web.UI.HtmlControls.HtmlTitle":
                    return new JHtmlTitle(GetAsType<HtmlTitle>(_control));
                default:
                    return new JHtmlControl(GetAsType<HtmlControl>(_control));
            }
        }
    }
}
